#ifndef TD_MANAGER_H_
#define TD_MANAGER_H_

/************************************************************************/
/* STL                                                                  */
/************************************************************************/
#include <map>
#include <string>
#include <iostream>
#include <sstream>


using namespace std;


namespace TD_Game {

	template<class T>
	class Manager {

		
	protected:
		
		//Object map
		map<unsigned int, T *> m_objMap;

		//Accessing the objects through strings
		map<string, T*> m_objStringMap;

		static unsigned int m_currObjId;

		/************************************************************************/
		/* ctors and dtors                                                      */
		/************************************************************************/
		
		//Default
		Manager();

		//Copy
		Manager(const Manager &rhs);

		//Assignment
		Manager & operator=(const Manager &rhs);

		/** Adds the object to the object map */
		void createObject(T * g_pObj);

		/** Adds the object to the object map */
		void createObject(const string &g_objStr, T * g_pObj);

		void createObject(unsigned int g_objID, T* g_pObj);

	public:
		
		/************************************************************************/
		/* Access functions                                                     */
		/************************************************************************/
		T* getObject(unsigned int objId) const ;

		T* getObject(const string objName) const; 
		

		const map<unsigned int, T*> & getObjectMap() const ;
		
		void deleteObject(unsigned int objId);

	};

}
#endif
